#!/usr/bin/env python
"""\
 Data from the JMol AtomTypes file. I like their colors

Copyright (c) 2003 Richard P. Muller (rmuller@sandia.gov). All rights
reserved. See the LICENSE file for licensing details.
"""

jmol_data = """\
X	X	0	0.0	1.0	0.0	255	20	147
H	H	1	1.008	1.20	0.32	250	235	215
He	He	2	4.003	1.40	0.93	255	192	203
Li	Li	3	6.941	1.82	1.23	178	34	34
Be	Be	4	9.0122	1.3725	0.90	34	139	34
B	B	5	10.811	0.795	0.82	0	255	0
C	C	6	12.011	1.70	0.77	112	128	144
N	N	7	14.007	1.55	0.75	0	191	255
O	O	8	15.999	1.52	0.73	255	0	0
F	F	9	18.998	1.47	0.72	218	165	32
Ne	Ne	10	20.18	1.54	0.71	255	105	180
Na	Na	11	22.99	2.27	1.54	0	0	255
Mg	Mg	12	24.312	1.73	1.36	34	139	34
Al	Al	13	26.982	1.7	1.18	190	190	190
Si	Si	14	28.086	2.10	1.11	218	165	32
P	P	15	30.974	1.80	1.06	255	165	0
S	S	16	32.06	1.80	1.02	255	255	0
Cl	Cl	17	35.453	1.75	0.99	0	255	0
Ar	Ar	18	39.948	1.88	0.98	255	192	203
K	K	19	39.098	2.75	2.03	255	20	147
Ca	Ca	20	40.078	2.45	1.74	128	128	128
Sc	Sc	21	44.956	1.37	1.44	190	190	190
Ti	Ti	22	47.9	1.37	1.32	190	190	190
V	V	23	50.941	1.37	1.22	190	190	190
Cr	Cr	24	51.996	1.37	1.18	190	190	190
Mn	Mn	25	54.938	1.37	1.17	190	190	190
Fe	Fe	26	55.847	1.456	1.17	255	165	0
Co	Co	27	58.933	0.88	1.16	165	42	42
Ni	Ni	28	58.71	0.69	1.15	165	42	42
Cu	Cu	29	63.54	0.72	1.17	165	42	42
Zn	Zn	30	65.37	0.74	1.25	165	42	42
Ga	Ga	31	69.72	1.37	1.26	165	42	42
Ge	Ge	32	72.59	1.95	1.22	85	107	47
As	As	33	74.9216	1.85	1.20	253	245	230
Se	Se	34	78.96	1.90	1.16	152	251	152
Br	Br	35	79.904	1.85	1.14	165	42	42
Kr	Kr	36	83.80	2.02	1.12	50	205	50
Rb	Rb	37	85.47	1.58	2.16	165	42	42
Sr	Sr	38	87.62	2.151	1.91	190	190	190
Y	Y	39	88.9059	1.801	1.62	190	190	190
Zr	Zr	40	91.224	1.602	1.45	190	190	190
Nb	Nb	41	92.9064	1.468	1.34	190	190	190
Mo	Mo	42	95.94	1.526	1.30	255	127	80
Tc	Tc	43	98.0	1.360	1.27	190	190	190
Ru	Ru	44	101.07	1.339	1.25	190	190	190
Rh	Rh	45	102.906	1.345	1.25	190	190	190
Pd	Pd	46	106.42	1.376	1.28	190	190	190
Ag	Ag	47	107.87	1.27	1.34	190	190	190
Cd	Cd	48	112.41	1.424	1.48	255	140	0
In	In	49	114.82	1.663	1.44	190	190	190
Sn	Sn	50	118.71	2.10	1.41	190	190	190
Sb	Sb	51	121.75	2.05	1.40	190	190	190
Te	Te	52	127.60	2.06	1.36	190	190	190
I	I	53	129.905	1.98	1.33	160	32	240
Xe	Xe	54	131.29	2.00	1.31	255	105	180	
Cs	Cs	55	132.905	1.84	2.35	165	42	42
Ba	Ba	56	137.33	2.243	1.98	190	190	190
La	La	57	138.906	1.877	1.69	190	190	190
Lu	Lu	71	174.967	2.17	1.60	190	190	190
Hf	Hf	72	178.49	1.580	1.44	190	190	190
Ta	Ta	73	180.948	1.467	1.34	190	190	190
W	W	74	183.85	1.534	1.30	64	224	208
Re	Re	75	186.207	1.375	1.28	190	190	190
Os	Os	76	190.2	1.353	1.26	190	190	190
Ir	Ir	77	192.22	1.357	1.27	190	190	190
Pt	Pt	78	195.08	1.75	1.30	190	190	190
Au	Au	79	196.967	1.66	1.34	255	215	0
Hg	Hg	80	200.59	1.55	1.49	190	190	190
Tl	Tl	81	204.383	1.96	1.48	190	190	190
Pb	Pb	82	207.2	2.02	1.47	190	190	190
Bi	Bi	83	208.98	2.15	1.46	255	181	197
"""

Symbol = [0]*84
Mass = [0]*84
Rvdw = [0]*84
Rcov = [0]*84
Color = [0]*84
Color2 = [0]*84

lines = jmol_data.split("\n")
for line in lines:
    words = line.split()
    if len(words) == 0: break
    sym = words[0]
    atno = int(words[2])
    mass = float(words[3])
    rvdw = float(words[4])
    rcov = float(words[5])
    red = int(words[6])
    green = int(words[7])
    blue = int(words[8])
    # fill arrays
    Symbol[atno] = sym
    Mass[atno] = mass
    Rvdw[atno] = rvdw
    Rcov[atno] = rcov
    Color[atno] = (red,green,blue)
    Color2[atno] = "#%1x%1x%1x" % (red/16,green/16,blue/16)


for color in Color: print color
#print "radius = [",
#for r in Rvdw: print "%10.4f " % r
